Skip to content

Add eval support for JerryScript debugger #1588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2017

Conversation

zherczeg
Copy link
Member

No description provided.

print(message)

prompt.cmdloop()

else:
raise Exception("Unknown message")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new line and of the file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"and of the file" - not really understand this

Copy link
Contributor

@polaroi8d polaroi8d Feb 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at end of file* 😈

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't get it, the file does not end there.

ord(result[1]) != 4 or
ord(result[2]) != JERRY_DEBUGGER_CONFIGURATION):
raise Exception("Unexpected configuration")
ord(result[1]) != 4 or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This format is for the PEP8 style guide.

# 1: length of type byte
# 4: length of an uint32 value
message_header = 1 + 4
max_fragment = min (self.debugger.max_message_size - message_header, size)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No white space before the '('.

@@ -0,0 +1,14 @@
Address setup: localhost:5001
Stopped at /home/hzoli/SamsungJS/Jerry/tests/debugger/do_eval.js:15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/hzoli/..?


if (message[0] == JERRY_DEBUGGER_EVAL_ERROR_END)
{
appendLog("ERROR: " + cesu8ToString(evalResult));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using "Uncaught: " here, and just going with to_string in case of error objects where you send the result? It would also signal that the thrown value is an object, and not just a thrown string.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the error message processing looks like this:

if (is_object(result))
  if (has_message_property(as_object(result)))
    send(as_object(result).message)
  else
    send(get_class_name(object))
else
   send(to_string(result))

My problem was with to_string is that it can throw another error...

raise Exception("Eval result expected")

if buffer_type == JERRY_DEBUGGER_EVAL_ERROR_END:
print("ERROR: %s" % (message))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And same here?

The server can accept a string, execute it with eval,
and returns with the result converted to string. In
case of exception it returns with the exception message.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
Copy link
Member

@dbatyai dbatyai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zherczeg zherczeg merged commit b02ef67 into jerryscript-project:master Feb 17, 2017
@zherczeg zherczeg deleted the debug_eval branch February 17, 2017 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants